function res = CalcPped( pnumsInit, lsteps, rsteps, ssf)
    %ssf = shift scale factor

    Wp = load('workParams.mat');

    pStr2Double_ = defParamSet(Wp.pdm);  
    k = keys(Wp.pdm);
    
    colsToDispLeft = length(pnumsInit);
    
    bounds = [];
    
    res = cp(pStr2Double_, pnumsInit);
    
    allgood = 3;
    for i = 1:length(res)
        t = res(i,:);
        g = t{2};
        allgood = min(allgood, min(g));
        %rp = res{1};
    end
    fprintf('min goodness val = %f\n',allgood);
    
    res = bounds;

    function r = cp(pStr2Double, pnums)    
        curColNum = pnums(1);
        pname = cell2mat(k(curColNum));
        pinfo = Wp.pdm(pname);
        lb = pinfo(2);
        rb = pinfo(3);
        defVal = pinfo(1);    
    
        %pvc = vertcat(pValsChanged, pname);
        r = [];               
        
        [ls,rs] = GetOptShift(curColNum);
        leftVal = defVal - ls * ssf(curColNum);
        rightVal = defVal + rs * ssf(curColNum);
        
        if colsToDispLeft > 0
            fprintf('Bounds of %15s   [%12.10f, %12.10f]\n', pname,leftVal,rightVal);
            bounds = vertcat(bounds, [leftVal rightVal]);
            colsToDispLeft = colsToDispLeft - 1;
        end
        
        if length(pnums) == 1
            pStr2Double(pname) = leftVal;
            plg = isParamsGood(Wp.pf, pStr2Double);
            
            subresl = [];
            for j = 1:length(pnumsInit) 
                pn = cell2mat(k(pnumsInit(j)));
                subresl = vertcat(subresl, {pn pStr2Double(pn)});
            end

            pStr2Double(pname) = rightVal;
            prg = isParamsGood(Wp.pf, pStr2Double);
            
            subresr = [];
            for j = 1:length(pnumsInit) 
                pn = cell2mat(k(pnumsInit(j)));
                subresr = vertcat(subresr, {pn pStr2Double(pn)});
            end
            goodness = [sum(plg) sum(prg)];
            resparams = {subresl, subresr};
            sbr = {resparams, goodness};
            r = vertcat(r,sbr);
            
            %fprintf('Changing %s\n', pname);
            %disp(resparams);
            %disp(goodness);
            %fprintf('\n');                        
        else
            pStr2Double(pname) = leftVal;
            r = vertcat(r, cp(pStr2Double, pnums(2:length(pnums))) );

            pStr2Double(pname) = rightVal;
            r = vertcat(r, cp(pStr2Double, pnums(2:length(pnums))) );
        end        
    end
end

